home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Transactor
/
Transactor_12_1986_Transactor_Publishing.d64
/
kernal who.src2
< prev
next >
Wrap
Text File
|
2023-02-26
|
1KB
|
42 lines
; program 2
; dump screen contents to disk using name found in first variable
; declared in BASIC program calling this routine. The first variable
; should be a string variable or the name may be rather strange.
;
start ldy #$02 ;offset to string length
lda ($2d),y ;get string length
beq exit ;zero length, quit while ahead
pha ;save length on stack
iny ;increment index
lda ($2d),y ;get low address of string
tax ;put in .x
iny ;increment index
lda ($2d),y ;get high order pointer
tay ;put in .y
pla ;pull length from stack
jsr $ffbd ;setnam: set file name
lda #$01 ;logical file #1
ldx #$08 ;device #8
ldy #$02 ;secondary address
jsr $ffba ;setlfs: set logical file
jsr $ffc0 ;open
bcs exit ;if carry set then error out
ldx #$01 ;file number
jsr $ffc9 ;chkout: set output channel to file 1
ldy #$00 ;zero index
sty $fd ;set pointer low byte
lda #$04 ;start of screen high byte
sta $fe ;set pointer high byte
loop lda ($fd),y ;get screen character
jsr $ffd2 ;chrout: output a byte to disk
iny ;increment index
bne loop ;not 256 yet?
inc $fe ;increment high byte of pointer
lda $fe ;get pointer high byte
cmp #$08 ;done four pages yet?
bcc loop ;if carry clear then no
lda #$01 ;file number 1
jsr $ffc3 ;close: close the file
exit jsr $ffe7 ;clall: restore default i/o channels
rts ;return to basic